<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorate="layout">
	<!-- data-layout-decorator="pages/test"> -->

	<head>
		<meta charset="UTF-8" />
		<title>RA-网络安全风险评估系统</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

		<link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
		<link href="/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" />

		<link href="/css/jquery.mmenu.css" rel="stylesheet" />

		<link href="/css/style.css" rel="stylesheet" />
		<link href="/css/add-ons.min.css" rel="stylesheet" />

		<style type="text/css">
			html,
			body,
			.mm-page,
			.mm-page .content,
			#iframeDiv,
			.mm-page .content .row,
			#iframeDiv iframe {
				width: 100%;
				height: 100%;
				overflow: hidden;
			}
			
			#iframeDiv {
				padding: 140px 37px 38px 278px;
				overflow: auto;
			}
			
			.nav>li:hover {
				background-color: #FFF;
			}
		</style>
	</head>

	<body>
		<div class="navbar" role="navigation">
			<div class="sidebar" style="height: auto;">
				<div class="sidebar-collapse">
					<div class="sidebar-header">
						<img src="/img/logo.png" class="img-responsive" alt="" />
					</div>
				</div>
			</div>

			<div class="container-fluid container-nav">
				<div class="navbar-right">
					<div class="userbox">
						<a th:href="@{/logout}"><span class="name">登出系统</span></a>
					</div>
				</div>
			</div>
		</div>

		<div class="container-fluid content">
			<div class="page-header">
				<div class="pull-left">
					<ol class="breadcrumb visible-sm visible-md visible-lg">
						<li>
							<a th:href="@{/goHome}"><i class="icon fa fa-home"></i>首页</a>
						</li>
						<li id="pageName">脆弱性识别</li>
					</ol>
				</div>
			</div>

			<div class="row" th:fragment="content">
				<div class="sidebar">
					<div class="sidebar-collapse">
						<div class="sidebar-header">
							<div class="img-responsive"></div>
						</div>
						<div style="overflow-y: scroll;overflow-x:hidden;width: 270px;">
							<nav id="menu" class="nav-main" role="navigation">
								<ul class="nav nav-sidebar" th:if="${menuList?.size() != 0}">
									<li th:each="me,iterState:${menuList}">
										<a th:attr="href='/pro/pageLink/'+${projectId}+'/'+${groupArr}+'/'+${me.id}">
											<i class="fa fa-laptop" aria-hidden="true"></i>
											<span th:text="${me.name}">菜单项</span>
										</a>
									</li>
								</ul>
							</nav>
						</div>
					</div>
					<div class="sidebar-footer" style="display: none;"></div>
				</div>

				<div id="iframeDiv">
					<div id='iframe' frameborder="no" border="0" scrolling="yes" allowtransparency="yes">

						<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
							<form th:action="@{/weak/importExcel}" method="POST" enctype="multipart/form-data" class="col-md-6 alert alert-danger" style="padding: 8px 0px;margin-left:-15px;">
								<label class="col-md-3 control-label label_left" for="file-input" style="margin-top:10px;min-width:140px;">脆弱性识别文件：</label>
								<div class="col-md-7" style="margin-left:-34px">
									<input type="text" th:attr="value=${projectId}" name="projectId" style="display:none;"/>
									<input name="file" type="file" class="form-control" id="upload_file" style="display: none;" onchange="change();" />
									<input type="text" class="form-control" id="upload_file_tmp" name="upload_file_tmp" readonly="readonly" onclick="upload_file.click(); " />
								</div>
								<button class="col-md-1 btn btn-primary button_right" id="select_file" style="padding:6px 6px;min-width:70px;">上传</button>
							</form>
							
							<!-- <form id='fileForm' class="col-md-6 alert alert-danger" style="padding: 8px 0px;margin-left:-15px;">
								<label class="col-md-3 control-label label_left" for="file-input" style="margin-top:10px">上传资产文件：</label>
								<div class="col-md-8" style="margin-left:-34px">
									<input type="text" th:attr="value=${projectId}" name="projectId" style="display:none;"/>
									<input type="file" name="file" class="form-control" id="upload_file" style="display: none;" onchange="change();" />
									<input type="text" class="form-control" id="upload_file_tmp" readonly="readonly" onclick="upload_file.click(); "/>
								</div>
								<button class="col-md-1 btn btn-primary button_right" id="select_file" style="padding:6px 6px;min-width:70px;">上传</button>
							</form> -->

							<form th:action="@{/weak/exportExcel}">
								<div class="col-md-6">
									<div class="alert alert-danger" style="margin-right:-15px;" onclick="downBtn.click()">
										<input type="text" th:attr="value=${projectId}" name="projectId" style="display:none;"/>
										<span class="name">下载威胁赋值文件</span>
										<button style="display:none;" id="downBtn"></button>
									</div>
								</div>
							</form>
						</div>

						<div class="sidebar-minified">
							<div class="row" th:if="${weakGroups?.size() != 0}">
								<div th:each="weak : ${weakGroups}" class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
									
									<div id="hardware" class="panel panel-default bk-bg-white">
										<div class="panel-heading bk-bg-white">
											<h6>
												<i class="fa fa-table red" style="width:auto;"></i><span class="break"></span>
												<span th:text="'重要资产威胁识别表--'+${weak?.key}">Default</span>
											</h6>
											<div class="panel-actions">
												<a href="#" class="addToTable"><i class="fa fa-plus" style="color:#ff5454"></i></a>
												<a href="#" class="btn-minimize"><i class="fa fa-caret-up" style="color:#ff5454"></i></a>
											</div>
										</div>
										<div class="panel-body">
											<table class="table table-bordered table-striped mb-none" id="datatable-editable">
												<thead>
													<tr>
														<th>序号</th>
														<th>资产名称</th>
														<th>脆弱性名称</th>
														<th>操作</th>
													</tr>
												</thead>
												<tbody th:each="tr , itemState: ${weak?.value}">
													<tr th:each="td : ${tr}" class="gradeA" style="display:none;">
														<tr th:if="${td?.weaknessList?.size() == 0}">
															<td class="numerical" th:text="${itemState.count}">序号</td>
															<td th:text="${tr?.name}">资产名称</td>
															<td></td>
															<td></td>
														</tr>
														
														<tr th:if="${td?.weaknessList?.size() != 0}"  th:each="weakItem , weakState: ${td.weaknessList}" style="display:none;">
															<tr th:if="${weakState.index == 0}">
																<td class="numerical" th:text="${itemState.count}" th:attr="rowspan=${weakState?.size}">序号</td>
																<td th:text="${tr?.name}" th:attr="rowspan=${weakState?.size}">资产名称</td>
																<td th:text="${weakItem.name}"></td>
																<td class="actions" >
																	<a href="#" class="hidden on-editing save-row"><i class="fa fa-save"></i></a>
																	<a href="#" class="hidden on-editing cancel-row"><i class="fa fa-times"></i></a>
																	<a href="#" class="on-default edit-row"><i class="fa fa-pencil"></i></a>
																	<a href="#" class="on-default remove-row"><i class="fa fa-trash-o"></i></a>
																</td>
															</tr>
																
															<tr th:if="${weakState.index != 0}">
																<td th:text="${weakItem}"></td>
																<td class="actions" >
																	<a href="#" class="hidden on-editing save-row"><i class="fa fa-save"></i></a>
																	<a href="#" class="hidden on-editing cancel-row"><i class="fa fa-times"></i></a>
																	<a href="#" class="on-default edit-row"><i class="fa fa-pencil"></i></a>
																	<a href="#" class="on-default remove-row"><i class="fa fa-trash-o"></i></a>
																</td>
															</tr>
														</tr>
													</tr>
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
						</div>
						
						
					</div>
				</div>
			</div>
		</div>

		<script src="/vendor/js/jquery-2.1.1.min.js"></script>
		<script src="/vendor/bootstrap/js/bootstrap.min.js"></script>

		<script src="/plugins/select2/select2.js"></script>
		<script src="/plugins/jquery-datatables/media/js/jquery.dataTables.js"></script>
		<script src="/plugins/jquery-datatables-bs3/js/datatables.js"></script>

		<script src="/js/jquery.mmenu.min.js"></script>
		<script src="/js/core.min.js"></script>

		<!-- <script src="/js/table-editable.js"></script> -->
		<script src="/pagesJs/table.js"></script>
	</body>

</html>